<!DOCTYPE HTML>
<html>
<head>
    <title>Fibonacci</title>
</head>
<body>
<script type="text/javascript">
    var fibonacii = function(n){
        //return n<2?n:arguments.callee(n-1)+arguments.callee(n-2);
        return n<2?n:fibonacii(n-1)+arguments.callee(n-2);
    }
    var display = function(){
        var n = document.getElementById("input_args").value;
        var date1 = Date.now();
        var f = fibonacii(n);
        var date2 = Date.now();
        var cost = date2 - date1;
        alert("date1:"+date1+";date2:"+date2+";cost:"+cost+";Fibonacii:"+f);
    }
    var testCallee = function(n){
        alert(n);
        if(n<50){
         arguments.callee(n+10);
        //testCallee(n+10);
        }
    }
</script>
    <input type="text" id="input_args"/>
    <br/>
    <input type="button" onclick="display()" value="Display the Fibonacii"/>
    <br/>
    0 1 1 2 3 5 8 13 21 34 ...
    <br/>
    0 1 2 3 4 5 6 7  8  9  ...
    <br/>
    <input type="button" onclick="testCallee(10)" value="Test Callee"/>
</body>
</html>